package l2ft.gameserver.utils;

import l2ft.commons.text.PrintfFormat;
import l2ft.gameserver.hwid.HwidGamer;
import l2ft.gameserver.model.Player;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Log
{
	public static final PrintfFormat LOG_BOSS_KILLED = new PrintfFormat("%s: %s[%d] killed by %s at Loc(%d %d %d) in %s");
	public static final PrintfFormat LOG_BOSS_RESPAWN = new PrintfFormat("%s: %s[%d] scheduled for respawn in %s at %s");

	private static final Logger _logGame = LoggerFactory.getLogger("game");
	private static final Logger _logDebug = LoggerFactory.getLogger("debug");

	public static void debug(String text)
	{
		_logDebug.debug(text);
	}

	public static void debug(String text, Throwable t)
	{
		_logDebug.debug(text, t);
	}

	public static void LogGame(String name, String text)
	{
		StringBuilder output = new StringBuilder();
		output.append(name);
		output.append(": ");
		output.append(text);

		_logGame.info(output.toString());
	}

	public static void LogAction(Player player, String action, String text)
	{
		StringBuilder output = new StringBuilder();
		
		output.append(player);
		output.append(" ");
		output.append(action);
		output.append(": ");
		output.append(text);

		player.getMyLogger().info(output.toString());
	}
	
	public static void LogHwid(HwidGamer gamer, String playerName, String action, String text)
	{
		if(gamer == null)
			return;
		StringBuilder output = new StringBuilder();
		
		output.append(playerName);
		output.append(" ");
		output.append(action);
		output.append(": ");
		output.append(text);

		gamer.getMyLogger().info(output.toString());
	}
}